package com.ourfox.a4.commons.dao;

import java.util.Collection;

import com.ourfox.a4.commons.exception.PortalException;

/**
 * 
 * @Description: 定义的DAO的基础操作方法,增、删、改
 * @author xiujin.luo@gmail.com
 * @date 2013-4-11 上午1:57:36 
 * @version V1.0.0
 * @param <PO>
 * @param <ID>
 */
public interface ManageDao<PO, ID> {
	
	/**
	 * 
	 * @Description: 添加数据
	 * @param po
	 * @throws PortalException    
	 * @return int     
	 */
	public int add(PO po)throws PortalException;
	
	/**
	 * 
	 * @Description: 批量添加数据
	 * @param poList
	 * @throws PortalException    
	 * @return int     
	 */
	public int addBatch(Collection<PO> poList)throws PortalException;
	
	/**
	 * 
	 * @Description: 修改操作
	 * @param @param po
	 * @throws PortalException    
	 * @return void     
	 */
	public void update(PO po)throws PortalException;
	
	/**
	 * 
	 * @Description: 批量修改
	 * @param poList
	 * @throws PortalException    
	 * @return void     
	 */
	public void updateBatch(Collection<PO> poList)throws PortalException;

	/**
	 * 
	 * @Description: 跟据主健删除数据
	 * @param id 主健
	 * @throws PortalException    
	 * @return void     
	 */
	public void removeById(ID id)throws PortalException;
	
	/**
	 * 
	 * @Description: 跟据条件删除数据
	 * @param po 条件值
	 * @throws PortalException    
	 * @return void     
	 */
	public void remove(PO po)throws PortalException;
	
	/**
	 * 
	 * @Description: 批量删除,跟据主健
	 * @param idList 主健List
	 * @throws PortalException    
	 * @return void     
	 */
	public void removeBatch(Collection<ID> idList)throws PortalException;
	
}
